<?php

function getColours(){
    $colours = array(
        "red"=>"#f00",
        "green"=>"#0f0",
        "blue"=>"#00f",
        "yellow"=>"#ff0",
        "fuicia"=>"#f0f",
    );
    foreach($colours as $name=>$title){ ?>
        <span title="<?=$title?>" class="colour" id="<?=$name?>" style="background-color:<?=$title?>">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>
<?php
    }
}

function submitGraffiti($comment_id, $graffiti){
	$table = 'graffiti';
	$query = "INSERT INTO $table (`comment_id`, `graffiti`) VALUES ($comment_id, $graffiti)";
	$link = mysql_connect('localhost', 'root', '');
	$db = mysql_select_db('test', $link);
	return mysql_query($graffiti, $link);
}

function installGraffiti(){
//	CREATE TABLE `test`.`graffiti` (
//		`id` BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY ,
//		`comment_id` BIGINT NOT NULL ,
//		`graffiti` LONGTEXT NOT NULL
//	) ENGINE = MYISAM
}

function getGraffiti(){
	$table = 'graffiti';
	$query = "SELECT * FROM graffiti WHERE 1 LIMIT 10";
	$link = mysql_connect('localhost', 'root', '');
	$db = mysql_select_db('test', $link);
	return mysql_query($graffiti, $link);
}
?>